package cn.dhnep.demo.controller;


import cn.dhnep.demo.pojo.vo.RespPageBean;
import cn.dhnep.demo.service.AccountService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author dhn
 * @since 2021-08-31
 */
@RestController
@RequestMapping("/dhn/account")
public class AccountController {

    @Resource
    private AccountService accountService;

    @ApiOperation("获取所有账户")
    @GetMapping("getAllAccount")
    public RespPageBean getAllAccount(@RequestParam(defaultValue = "1") Integer page,
                                      @RequestParam(defaultValue = "15") Integer limit,
                                      @RequestParam(value = "type", required = false) Integer type,
                                      @RequestParam(value = "userName", required = false) String userName) {
        return accountService.pageQueryAccount(page, limit, type, userName);
    }

}

